package com.tszs.util;

import java.sql.DriverManager;
import java.sql.SQLException;

import com.mysql.jdbc.Connection;

public class JDBCUtils {
	private final static String user="root";
	private final static String password="1234";
	private final static String driver="com.mysql.jdbc.Driver";
	private final static String url="jdbc:mysql://localhost:3306/system?characterEncoding=utf-8";
	public static Connection conn() throws ClassNotFoundException, SQLException {
		Connection conn=null;
		Class.forName(driver);
		conn=(Connection) DriverManager.getConnection(url,user,password);
		return conn;
	}
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		System.out.println(JDBCUtils.conn());
	}
}
